#ifndef VIDEOPLAYRWIDGET_H
#define VIDEOPLAYRWIDGET_H

#include <QVideoWidget>
#include <QMediaPlayer>
#include <QMediaPlaylist>

class VideoPlayWidget : public QVideoWidget
{
    Q_OBJECT
public:
    explicit VideoPlayWidget(QWidget *parent = nullptr);
    ~VideoPlayWidget();

    using PlayMode = QMediaPlaylist::PlaybackMode;

    void setPlayMode(PlayMode playMode);
    void setPlayList(QStringList fileList);
    void setMuted(bool mute);
    void play(int id = -1);
    void stop();
    void playPrev();
    void playNext();

    bool isPlaying() const;
    int currentId() const;

signals:

private:
    QMediaPlaylist* m_mediaList;
    QMediaPlayer* m_player;

};

#endif // VIDEOPLAYRWIDGET_H
